<?php

/**
 * This is the model class for table "d_satker".
 *
 * The followings are the available columns in table 'd_satker':
 * @property integer $ID
 * @property string $THANG
 * @property string $KDSATKER
 * @property string $KDDEPT
 * @property string $KDUNIT
 * @property string $NIPKPA
 * @property string $NAMAKPA
 * @property string $JABATAN1
 * @property string $JABATAN2
 * @property string $JABATAN3
 * @property string $ALAMAT
 * @property string $KOTA
 * @property string $NIPBEND
 * @property string $NAMABEND
 * @property string $NIPSPM
 * @property string $NAMASPM
 * @property string $SALDOAWAL
 * @property string $_NullFlags
 */
class DSatker extends CActiveRecord
{
	/**
	 * Returns the static model of the specified AR class.
	 * @param string $className active record class name.
	 * @return DSatker the static model class
	 */
	public static function model($className=__CLASS__)
	{
		return parent::model($className);
	}

	/**
	 * @return string the associated database table name
	 */
	public function tableName()
	{
		return 'd_satker';
	}

	/**
	 * @return array validation rules for model attributes.
	 */
	public function rules()
	{
		// NOTE: you should only define rules for those attributes that
		// will receive user inputs.
		return array(
			array('THANG', 'length', 'max'=>4),
			array('KDSATKER', 'length', 'max'=>6),
			array('KDDEPT', 'length', 'max'=>3),
			array('KDUNIT', 'length', 'max'=>2),
			array('NIPKPA, NAMAKPA, JABATAN1, JABATAN2, JABATAN3, ALAMAT, NAMABEND, NAMASPM', 'length', 'max'=>60),
			array('KOTA', 'length', 'max'=>20),
			array('NIPBEND, NIPSPM', 'length', 'max'=>25),
			array('SALDOAWAL', 'length', 'max'=>19),
			array('_NullFlags', 'safe'),
			// The following rule is used by search().
			// Please remove those attributes that should not be searched.
			array('ID, THANG, KDSATKER, KDDEPT, KDUNIT, NIPKPA, NAMAKPA, JABATAN1, JABATAN2, JABATAN3, ALAMAT, KOTA, NIPBEND, NAMABEND, NIPSPM, NAMASPM, SALDOAWAL, _NullFlags', 'safe', 'on'=>'search'),
		);
	}

	/**
	 * @return array relational rules.
	 */
	public function relations()
	{
		// NOTE: you may need to adjust the relation name and the related
		// class name for the relations automatically generated below.
		return array(
		);
	}

	/**
	 * @return array customized attribute labels (name=>label)
	 */
	public function attributeLabels()
	{
		return array(
			'ID' => 'ID',
			'THANG' => 'Thang',
			'KDSATKER' => 'Kdsatker',
			'KDDEPT' => 'Kddept',
			'KDUNIT' => 'Kdunit',
			'NIPKPA' => 'Nipkpa',
			'NAMAKPA' => 'Namakpa',
			'JABATAN1' => 'Jabatan1',
			'JABATAN2' => 'Jabatan2',
			'JABATAN3' => 'Jabatan3',
			'ALAMAT' => 'Alamat',
			'KOTA' => 'Kota',
			'NIPBEND' => 'Nipbend',
			'NAMABEND' => 'Namabend',
			'NIPSPM' => 'Nipspm',
			'NAMASPM' => 'Namaspm',
			'SALDOAWAL' => 'Saldoawal',
			'_NullFlags' => 'Null Flags',
		);
	}

	/**
	 * Retrieves a list of models based on the current search/filter conditions.
	 * @return CActiveDataProvider the data provider that can return the models based on the search/filter conditions.
	 */
	public function search()
	{
		// Warning: Please modify the following code to remove attributes that
		// should not be searched.

		$criteria=new CDbCriteria;

		$criteria->compare('ID',$this->ID);
		$criteria->compare('THANG',$this->THANG,true);
		$criteria->compare('KDSATKER',$this->KDSATKER,true);
		$criteria->compare('KDDEPT',$this->KDDEPT,true);
		$criteria->compare('KDUNIT',$this->KDUNIT,true);
		$criteria->compare('NIPKPA',$this->NIPKPA,true);
		$criteria->compare('NAMAKPA',$this->NAMAKPA,true);
		$criteria->compare('JABATAN1',$this->JABATAN1,true);
		$criteria->compare('JABATAN2',$this->JABATAN2,true);
		$criteria->compare('JABATAN3',$this->JABATAN3,true);
		$criteria->compare('ALAMAT',$this->ALAMAT,true);
		$criteria->compare('KOTA',$this->KOTA,true);
		$criteria->compare('NIPBEND',$this->NIPBEND,true);
		$criteria->compare('NAMABEND',$this->NAMABEND,true);
		$criteria->compare('NIPSPM',$this->NIPSPM,true);
		$criteria->compare('NAMASPM',$this->NAMASPM,true);
		$criteria->compare('SALDOAWAL',$this->SALDOAWAL,true);
		$criteria->compare('_NullFlags',$this->_NullFlags,true);

		return new CActiveDataProvider($this, array(
			'criteria'=>$criteria,
		));
	}
}